All Functions Used So Far, Week 9

geom_smooth

{GGPLOT2}

Generates a smoothed conditional means curve / line

summary

{base}

Obtain summary statistics or detailed regression output

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

with

{base}

evaluate expression in the context of a data frame

xlab

{GGPLOT2}

Label the x axis (ggplot)

setwd

{base}

Set Working Directory

chisq.test

{stats}

Chi-Squared test (e.g. for cross-tabulations)

relevel

{stats}

Reorder Levels of Factor

as.numeric

{base}

Coerce a vector to numeric

confint

{stats}

Calculate confidence Intervals for Model Parameters

read_dta

{haven}

Read a .dta file (Stata data)

c

{base}

Combine values/vectors into a vector

prop.table

{base}

Transform frequency table into table of proportions

ifelse

{base}

Return a or b depending on the value of test

read_excel

{readxl}

Read an Excel file

names

{base}

Retrieve names of a list/vector

subset

{base}

Return subsets of vectors, matrices or data frames which meet conditions.

levels

{base}

Get levels of a factor

attach

{base}

Attach Set of R Objects to Search Path

cut

{base}

Convert Numeric to Factor

is.element

{base}

Check if a value is element of a vector

log

{base}

log (default base = e)

recode

{dplyr}

Recode a variable

lm

{base}

Fit a linear model

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

ls

{base}

Return a vector of character strings giving the names of the objects in the specified environment

ordered

{dplyr}

Create an ordered factor

theme_classic

{GGPLOT2}

A minimalistic theme with no gridlines

prop.test

{stats}

Test of Equal or Given Proportions

leveneTest

{car}

Computes Levene’s test for homogeneity of variance across groups.

ylab

{GGPLOT2}

Label the y axis (ggplot)

rm

{base}

Remove objects

droplevels

{base}

Drop Unused Levels from Factors

t.test

{stats}

Performs one and two sample t-tests on vectors of data.

ggplot

{GGPLOT2}

Create a ggplot graph

mutate

{dplyr}

Modify/create a column in a data frame

library

{base}

Load an R package

scale_x_continuous

{GGPLOT2}

Customise continuous x axis

stargazer

{stargazer}

Create a regression output table

scale_y_continuous

{GGPLOT2}

Customise continuous y axis

as.character

{base}

Coerce a vector to character

geom_point

{GGPLOT2}

Generates a scatter plot

aes

{GGPLOT2}

Construct aesthetic mapping of a ggplot graph

The end!